package com.project.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.project.bean.LogBean;
import com.project.mapper.ILogMapper;
import com.project.service.ILogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;

@Service
@Transactional
public class LogServiceImpl implements ILogService {

    @Autowired
    private ILogMapper logMapper;
    @Override
    public PageInfo<LogBean> findByDate(Integer pageNo, LocalDate startDate,
                                        LocalDate endDate) {

        PageHelper.startPage(pageNo,PAGESIZE);
        return PageInfo.of(logMapper.findByDate(startDate,endDate));

    }
}
